home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
DATAUTIL
/
DBASEUT1.LZH
/
DB3DIR.PRG
< prev
next >
Wrap
Text File
|
1987-06-09
|
2KB
|
71 lines
* NAME: DB3DIR.PRG V 1.2
* LAST UPDATE: 09/11/86 ASCII CHR:F
* DATABASE [INDEX]: DIRSTRU.DBF
* REMARKS: Create directory file in .dbf format
* dBASEIII is a trademark of ASHTON-TATE
* V1.2 added ability to use on multi-user system
*------------------------------------------------------------------------------
* initialization stuff
SET EXCL ON
SET TALK OFF
SET HEAD OFF
SET SCOR OFF
SET SAFE OFF
ZDRIVE=[ ]
ZDEST=[ ]
ZLOC=[ ]
ZNAME=[ ]
* Set up screen and get user inputs
CLEA
@ 3,10 TO 6,55 DOUB
@ 4,22 SAY [DB3DIR.PRG V 1.2]
@ 5,15 SAY [dBASEIII+* .DBF-format directory program]
@ 8,0
TEXT
This program uses the DOS directory routine to get the list of
files in any given drive. It then reformats the list into a
dBASEIII .DBF file on any drive you choose. Safety is set
off so any xDIR.DBF file will be overwritten ('x' is the
letter designator of the drive from which the directory is taken.)
DIRSTRU.DBF is required
ENDT
@ 17,7 TO 22,59
@ 18,15 SAY [Directory of which drive?: ]
@ 19,15 say [Write directory to which drive? :]
@ 20,15 SAY [What drive for DIRSTRU.dbf? :]
@ 21,15 SAY [DBF Name? Default is xDIR>DBF :]
@ 18,45 get ZDRIVE && directory drive
@ 19,50 GET ZDEST && drive where dir.dbf will be written
@ 20,48 get ZLOC && drive locator for dirstru.dbf
@ 21,48 get ZNAME && intermediate directory name
@ 24,15 SAY [dBASEIII is a trademark of ASHTON-TATE]
READ
ZDOC=ZDRIVE+[DIR.DOC]
IF ZNAME<>[ ]
ZNAME=ZDEST+[:]+ZNAME
ELSE
ZNAME=ZDEST+[:]+ZDRIVE+[DIR]
ENDIF
ZDIR=[ DIR ]+ZDRIVE+[:>]+ZDEST+[:]+ZDOC && set up DOS command
ZDSLOC=ZLOC+[:DIRSTRU] && set up to get structure
ZDDOC=ZDEST+[:]+ZDOC && set up destination file
SET TALK ON
USE &ZDSLOC
COPY STRU TO &ZNAME && create final database
!&ZDIR && DOS directory file creation
USE &ZNAME
APPE FROM &ZDDOC SDF && fill .dbf from intermediate file
GOTO 1
* nxt statement deletes blanks and titles
DELE FOR SUBSTR(NAME,1,1)=[ ] .OR. SUBSTR(NAME,1,1)=[.]
PACK
CLOS DATA
SET TALK OFF
ERASE &ZDDOC && delete intermediate file
CLEA
@8,10 TO 10,62 DOUB
@ 9,15 SAY [Name of directory file is: ]+TRIM(ZNAME)+[.DBF]
SET EXCL OFF